      
      
      <div class="mota">
            <div class="img_list_group">
                Danh sách Tổng thành viên của các group
            </div>
           </div>
           <?php 
           ;
           foreach ($this->Admin_model->get_data('users_group',array('type'=>1)) as $group){
                $mgroup[$group->id]=$group;
           }
           echo '<pre>';
           //$credit['group']// diem tong cua group
           //$credit['id']// diem tong cua id
          // print_r($credit);
           echo '</pre>';
           ?>     
                
                <table class="tb_content clearfix">
                     <form>
                        <tr>
                           <th class="first_id"><a title="id" href="#" class="order">id</a></th>
                            <th><a title="title" href="#" class="order">Username</a></th>
                            <th><a title="" href="#">Group</a></th>
                            <th><a title="phone" href="#" class="order">Phone</a></th>
                            <th><a title="yahoo" href="#" class="order">Yahoo</a></th>
                            
                            <th><a title="" href="#" class="">Total</a></th>
                            <th><a title="" href="#" class="">curent</a></th>
                            <th><a title="" href="#" class="">pending</a></th>
                            <th>View</th>
                            <th>Status</th>
                            <th>edit</th>
                            <th>delete</th>
                            <th class="tb_check"><input class="checkall" type="checkbox" /></th>
                        </tr>
                        <?php
                        if(!empty($dulieu)){
                            foreach($dulieu as $dulieu){?>                                
                         <tr>
                            <td class="first_id"><?php echo $dulieu->id;?></td>
                            <td><?php echo $dulieu->username;?></td>
                            <td class="group_td"><?php if(!empty($mgroup[$dulieu->idgroup])){echo $mgroup[$dulieu->idgroup]->username;}?></td>
                            <td><?php echo $dulieu->phone;?></td>
                            <td><?php echo $dulieu->yahoo;?></td>
                            <td class="total_td">$ <?php if(!empty($credit[$dulieu->id][0]->total)){echo $credit[$dulieu->id][0]->total/100;}else echo 0;?></td>
                            <td class="curent_td">$ <?php if(!empty($credit[$dulieu->id][0]->curent)){echo $credit[$dulieu->id][0]->curent/100;}else echo 0;?></td>
                            <td class="pending_td">$ <?php if(!empty($credit[$dulieu->id][0]->pending)){echo $credit[$dulieu->id][0]->pending/100;}else echo 0;?></td>
                            <td class="view span30"><a href="<?php echo base_url().'admin/usergroup/listmem/'.$dulieu->id;?>">view</a></td>
                            <td class="span30 views"><a class="status ajax <?php echo $dulieu->banned==0? 'unpub':''; ?>" id="<?php echo $dulieu->id;?>" href="<?php echo base_url().'admin/ajax/unpub/'.$this->uri->segment(3).'/banned/';?>">banned</a></td>
                            <td class="edit span30"><a href="<?php echo base_url().'admin/route/users_group/edit/'.$dulieu->id;?>">edit</a></td>
                            <td class="del span30"><a href="<?php echo base_url().'admin/route/'.$this->uri->segment(3).'/delete/'.$dulieu->id;?>">del</a></td>
                            <td class="tb_check"><input type="checkbox" name="checkb[]" value="<?php echo $dulieu->id;?>" /></td>
                        </tr>   
                                
                        <?php    }
                        }
                        ?>
                       </form>    
                    </table><!-- end table content-->                     
                     
                    
                 